#{extends 'main.html' /}
#{set title:'Mes fiches de lecture' /}

    
	    
<div class="form">
	    <span class="bigtitle">Fiches de lecture</span>

	    <div id="cmd_add"
			class="ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-primary">
			<span class="ui-button-icon-primary ui-icon ui-icon-plus"></span>
		</div>
	    
	    #{paginate.controls items:list /} 
	    #{paginate.summary items:list /}
	    <table class="table_gridview">
		    <tr>
		    	<th>Série</th>
		    	<th>Titre</th>
		    	<th>Auteur</th>
		    	<th>Date de lecture</th>
		    </tr>
		    #{paginate.list items:list, as:'sheet2'} 
	    		<tr class="${sheet2_parity}">
	    			<td>#{if sheet2.book.collection != null}${sheet2.book.collection.title}#{/if}</td>
	    			<td>
	    				<a href="@{readingsheetmngt.displayone(sheet2.id)}">
	    					${sheet2.book.title}
	    				</a>
	    			</td>
	    			<td>
	    				<a href="@{author.displaylist(sheet2.book.author.id)}">
	    					${sheet2.book.author.firstname} ${sheet2.book.author.name}
	    				</a>
	    			</td>
	    			<td>#{if sheet2.readingdate != null}${sheet2.readingdate.format('MMMMM yyyy')}#{/if}</td>
	    		</tr>
		    #{/paginate.list}
		</table>
	    #{else}
	      Empty list!
	    #{/else}
	    
</div>
	   
<script language="javascript" type="text/javascript">
$(document).ready(function(){

	$("#cmd_add").click(function() {
		window.location = '@{readingsheetmngt.addform}'
	});

});
</script>
	    